home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat3
/
Tcl
/
foreach.z
/
foreach
Wrap
Text File
|
1998-10-30
|
2KB
|
67 lines
ffffoooorrrreeeeaaaacccchhhh((((3333TTTTccccllll)))) ffffoooorrrreeeeaaaacccchhhh((((3333TTTTccccllll))))
NNNNAAAAMMMMEEEE
foreach - Iterate over all elements in a list
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ffffoooorrrreeeeaaaacccchhhh _v_a_r_n_a_m_e _l_i_s_t _b_o_d_y
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
In this command _v_a_r_n_a_m_e is the name of a variable, _l_i_s_t is a list of
values to assign to _v_a_r_n_a_m_e, and _b_o_d_y is a Tcl script. For each element
of _l_i_s_t (in order from left to right), ffffoooorrrreeeeaaaacccchhhh assigns the contents of
the field to _v_a_r_n_a_m_e as if the lllliiiinnnnddddeeeexxxx command had been used to extract
the field, then calls the Tcl interpreter to execute _b_o_d_y. The bbbbrrrreeeeaaaakkkk and
ccccoooonnnnttttiiiinnnnuuuueeee statements may be invoked inside _b_o_d_y, with the same effect as
in the ffffoooorrrr command. FFFFoooorrrreeeeaaaacccchhhh returns an empty string.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
foreach, iteration, list, looping
PPPPaaaaggggeeee 1111